<?php

abstract class BaseController
{
	protected $registry;
	protected $o_configuration;
	protected $arr_forms;
	protected $arr_appConf;
	protected $o_em;
	protected $o_loader;
	public $o_subNavi;
	function __construct()
	{
		$this->registry = Claycode_ObjectRegister::getInstance();
		$this->o_em = Doctrine::get()->em;
		$this->arr_appForms = array(); 
		$this->o_configuration = Claycode_configuration::getInstance();
		$this->arr_appConf = $this->o_configuration->getCurrentAppConf();
		$this->registry->template = new Template();
		$this->o_loader = FileLoader::getInstance();
		
	}
	
	public function getSubNavi()
	{
		$arr_options = array(
					'pretty_urls'=> true,
					'is_sub_navi'=> false,
		);
		
		$arr_subApps = array(
			array(
				'app_ident'=> 'AdminUpdateHomeSlideShow',
				'app_display_name'=> 'update home',
				'controller_class'=> 'IM_C_ManageHome',
				'controller_class_alias'=> 'AdminManageHome',
				'hidden'=> false
			),
			array(
				'app_ident'=> 'AdminAddModel',
				'app_display_name'=> 'Add Model',
				'controller_class'=> 'IM_C_ManageModels',
				'controller_class_alias'=> 'AdminAddModelShow',
				'hidden'=> false
			),
			
			array(
				'app_ident'=> 'AdminShowModels',
				'app_display_name'=> 'View Models',
				'controller_class'=> 'IM_C_ManageModels',
				'controller_class_alias'=> 'AdminShowModelsShow',
				'hidden'=> false
			),
			
			array(
				'app_ident'=> 'AdminManageUsers',
				'app_display_name'=> 'Manage Users',
				'controller_class'=> 'IM_C_ManageUsers',
				'controller_class_alias'=> 'AdminManageUsersAlias',
				'hidden'=> false
			),
			
			array(
				'app_ident'=> 'AdminDoLogout',
				'app_display_name'=> 'Logout',
				'controller_class'=> 'LoginController',
				'controller_class_alias'=> 'IMAdminLogout',
				'js_load_function'=> '',
				'hidden'=>false
			),
			
		);
		
		$this->o_subNavi = new ClaycodeNaviMenu($arr_subApps, $arr_options);
		$this->registry->template->s_subNavi = $this->o_subNavi->getNaviHtml();
		
	}
	
	abstract function start();
}